set current_dir=C:\Program Files (x86)\OpenOffice 4\program\
pushd %current_dir%
echo %cd%
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
soffice -accept=socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager -nologo -headless -nofirststartwizard

exit